<?php
// +---------------------------------------------------------------------------+
// | This file is part of the KnowledgebasePublisher package                   |
// | KnowledgebasePublisher - web based knowledgebase publisher tool           |
// |                                                                           |
// | Author:  Evgeny Leontev <eleontev@gmail.com>                              |
// | Copyright (c) 2005 Evgeny Leontev                                         |
// |                                                                           |
// | For the full copyright and license information, please view the LICENSE   |
// | file that was distributed with this source code.                          |
// +---------------------------------------------------------------------------+

require_once 'eleontev/Validator.php';
require_once 'eleontev/Util/PasswordUtil.php';
	

class KBClientView_password extends KBClientView_common
{
	

	function &execute(&$manager) {
		
		$file = AppMsg::getCommonMsgFile('user_msg.ini');
		$this->msg = array_merge($this->msg, AppMsg::parseMsgs($file));
		
		$this->home_link = true;
		$this->meta_title = $this->msg['forgot_password_msg'];
		
		$data = $this->getTop($manager, $this->msg['forgot_password_msg'], false);
		$data .= $this->getForm();
		
		return $data;
	}
	

	function getForm() {
		
		$tpl = &new tplTemplatez($this->template_dir . 'password_form.html');
		
		if($this->getErrors()) { $tpl->tplAssign('user_msg', $this->getErrors()); }
		
		$tpl->tplAssign('action_link', $this->_getLink('all'));
		$tpl->tplAssign('cancel_link', $this->_getLink());															  
		
		$tpl->tplParse(array_merge($this->msg, $this->getFormData()));
		return $tpl->tplPrint(1);
	}
}
?>